package me.firstapp.repository.weixin.order;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import me.firstapp.common.utils.Page;
import me.firstapp.module.weixin.order.ProductOrder;
import me.firstapp.repository.base.EntityRepository;

public interface ProductOrderRepository extends EntityRepository<ProductOrder> {

	ProductOrder findByOrderNo(String openId, String orderNo);

	ProductOrder findByOrderNo(String orderNo);

	List<ProductOrder> findOrders(Integer status);

	List<ProductOrder> findOrders(Integer status, Integer settleFlag);

	List<ProductOrder> findOrdersPage(int pageIndex, int pageSize, String openId, Integer status);

	Page<ProductOrder> findProductOrderPage(Integer pageNo, Integer pageSize, Map<String, Object> searchParams,
			String sortParam, String sortType, Date startTime, Date endTime);

	BigDecimal findTotalPayAmountinTimes(String openId, Date start, Date end);
}
